#include "Log.hpp"
#include "ThreadPool.hpp"
#include "Task.hpp"
#include <memory>
using namespace LogModule;
using namespace ThreadPoolModule;

int main()
{

    Enable_Console_Log_Strategy();
    // Enable_File_Log_Strategy();

    sleep(5);
    int count = 10;
    while(count--)
    {
        sleep(1);

        ThreadPool<task_t>::GetInstance()->Enqueue(DownLoad);
    }
    ThreadPool<task_t>::GetInstance()->Stop();
    ThreadPool<task_t>::GetInstance()->Join();


    // Enable_Console_Log_Strategy();
    // // Enable_File_Log_Strategy();

    // ThreadPool<task_t>* tp = new ThreadPool<task_t>();

    // tp->Start();

    // sleep(5);
    // int count = 10;
    // while(count--)
    // {
    //     tp->Enqueue(DownLoad);
    //     sleep(1);
    // }
    // tp->Stop();
    // tp->Join();

    // ThreadPool<int>* tp = new ThreadPool<int>();

    // tp->Start();

    // sleep(5);

    // tp->Stop();
    // tp->Join();

    // Enable_File_Log_Strategy();
    // LOG(LogLevel::DEBUG) << "hello mihayou" << 666;
    // LOG(LogLevel::DEBUG) << "hello mihayou" << 666;

    // Enable_Console_Log_Strategy();
    // LOG(LogLevel::DEBUG) << "hello mihayou" << 666;
    // LOG(LogLevel::DEBUG) << "hello mihayou" << 666;
    
    // std::unique_ptr<LogStrategy> strategy = std::make_unique<ConsoleLogStrategy>();//C++14
    // std::unique_ptr<LogStrategy> strategy = std::make_unique<FileLogStrategy>();

    // strategy->SyncLog("hello mihayou!");

    // logger(LogLevel::DEBUG, "main.cc", 10) << "hello mihayou!" << " 666" << " 14";
    // logger(LogLevel::DEBUG, "main.cc", 10) << "hello mihayou!";
    // logger(LogLevel::DEBUG, "main.cc", 10) << "hello mihayou!";
    // logger(LogLevel::DEBUG, "main.cc", 10) << "hello mihayou!";
    // logger(LogLevel::DEBUG, "main.cc", 10) << "hello mihayou!";

    return 0;
}